package com.funong.matrix.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

@Getter
@AllArgsConstructor
public enum SystemIdEnum {
    /**
     * 系统类别
     */
    HUANG_HE(1, "黄河"),
    KUN_LUN(2, "昆仑");

    private Integer value;
    private String desc;

    public static SystemIdEnum valueOf(Integer value) {
        return Arrays.stream(values())
                .filter(systemIdEnum -> Objects.equals(value, systemIdEnum.desc))
                .findFirst()
                .orElse(HUANG_HE);
    }
}
